Be nicer in absence of a shortname.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sat, 20 Dec 2003 05:39:13 +0000 (05:39 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sat, 20 Dec 2003 05:39:13 +0000 (05:39 +0000)
gpsbabel/mapsend.c

index 23af6e9e0c8d91cd5a8b7f93c42e59e2c8548309..e9e1f2ff8e1b28ba68e26d5ca9d51519d0bc1c51 100644 (file)
@@ -401,7 +401,7 @@ mapsend_waypt_pr(const waypoint *waypointp)
                mkshort(mkshort_handle, waypointp->description) :
                waypointp->shortname;
 
-       c = strlen(sn);
+       c = sn ? strlen(sn) : 0;
        fwrite(&c, 1, 1, mapsend_file_out);
        fwrite(sn, c, 1, mapsend_file_out);
 
@@ -496,7 +496,7 @@ mapsend_route_disp(const waypoint *waypointp)
        route_wp_count++;
        
        /* waypoint name */
-       c = strlen(waypointp->shortname);
+       c = waypointp->shortname ? strlen(waypointp->shortname) : 0;
        fwrite(&c, 1, 1, mapsend_file_out);
        fwrite(waypointp->shortname, c, 1, mapsend_file_out);